<?php

namespace app\api\service;

use app\common\model\setting\Agreement;
use tmcore\base\BaseService;

class OtherService extends BaseService
{
    /**
     * 获取客服配置
     * @param $type
     * @return array
     */
    public static function getServiceConfig($type) : array
    {
        return DiyService::detail(['type' => $type, 'name' => 'service_page']);
    }

    /**
     * 获取协议内容
     * @param int $type
     * @return array
     */
    public static function getAgreementConfig($type) : array
    {
        return Agreement::where(['type' => $type])->findOrEmpty()->toArray();
    }

    /**
     * 获取关于我们
     * @return array
     */
    public static function getAboutConfig()
    {
        return [
            'name'        => '天茂网站系统',
            'identify'    => 'TM_WEBSITE',
            'version'     => '1.0.1',
            'is_official' => 'true'
        ];
    }
}